// 引入Vue
import Vue from 'vue'

// 引入vue-router
import VueRouter from 'vue-router'

// 使用vue-router
Vue.use(VueRouter)

// 引入组件
import Hero from './views/hero'
import AddHero from './views/addHero'
import EditHero from './views/editHero'
import Zb from './views/zb'
import Jn from './views/jn'

// 配置router
const router = new VueRouter({
    routes: [
        { path: '/', redirect: '/hero' },
        { path: '/hero', component: Hero },
        { path: '/zb', component: Zb },
        { path: '/jn', component: Jn },
        { path: '/hero/addHero', component: AddHero },
        { path: '/hero/editHero/:id', component: EditHero }
    ],
    // 激活css
    linkActiveClass: 'active'
})

// 导出router
export default router 